package Top_Interview_Questions._Other;

/**
 * @Author: 吕庆龙
 * @Date: 2020/3/15 20:55
 * <p>
 * 功能描述:
 */
public class _0334 {

    public static void main(String[] args) {
        _0334 test = new _0334();
        int[] nums = {1,2,-3,4,5,6};
        boolean b = test.increasingTriplet(nums);
    }

    public boolean increasingTriplet(int[] nums) {
        int i = 0;
        int small = Integer.MAX_VALUE, big =Integer.MAX_VALUE;


        while (i < nums.length) {
            if (nums[i] < small){
                small = nums[i];

            }  else if (nums[i] > small && nums[i] <= big) {
                big = nums[i];
            } else if (nums[i] > big){
                return true;
            }
            i ++;
        }

        return false;
    }
}
